package test;

import java.io.File;
import java.io.FileOutputStream;
import java.util.HashSet;
import java.util.Random;

public class GerarStringCpf {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		HashSet<StringBuilder> cpfs = new HashSet<StringBuilder>();
		Random r = new Random();
		StringBuilder cpf = new StringBuilder();
		while (cpfs.size() < 2000) {
			cpf.append("\"");
			for (int j = 0; j < 11; j++) {
				cpf.append(r.nextInt(10));
			}
			cpf.append("\",");
			cpfs.add(cpf);
			cpf = new StringBuilder();
		}
		
		File f = new File("c:\\cpfs.txt");
		File f2 = new File("c:\\cpfs2.txt");
		FileOutputStream fos = new FileOutputStream(f);
		FileOutputStream fos2 = new FileOutputStream(f2);
		long s = 0;
		for (StringBuilder stringBuilder : cpfs) {
			if (1000 > s) {
				fos.write(stringBuilder.toString().getBytes());
			}
			else {
				fos2.write(stringBuilder.toString().getBytes());
			}
			s++;
		}
		
		
		fos.close();
		fos2.close();
		
		
	}

}
